function ajax(url, method, options, callback) {
	$.ajax({
		url: url,
		type: method,
		data: options,
		dataType: "json",
		success: callback,
		error: function(xhr, status) {
			//$("body").append("status :" + status + " <br />return:<br />" + xhr.responseText);
		}
	});
}

function get_relative_path(url) {
	var last = url.lastIndexOf("/");
	return url.substr(0, last + 1);
}

function ajax_html(url, callback) {
	$.ajax({
		url: url,
		dataType: "html",
		success: callback,
		error: function() {
			$("#error").append("url:" + url + "没有找到");
		}
	});
}

// 同步的请求
function ajax_sync(url, callback) {
	$.ajax({
		url: url,
		dataType: "html",
		aysnc: false,
		success: callback,
		error: function() {
			$("#error").append("url:" + url + "没有找到");
		}
	});
}